<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.zust.java.bean.OrderDetail" %>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Producer订单细节</title>
</head>
<%
    List<Object> list = (List<Object>) request.getSession().getAttribute("orderDetail");
%>
<body>
<div>
<p><strong>生产者:订单详情</strong></p>
    <table border="1">
        <tr>
            <th>名称</th>
            <th>数量</th>
            <th>完成情况</th>
            <th>完成个数</th>
        </tr>
        <%
            for (Object oList : list) {
            OrderDetail orderDetail = (OrderDetail) oList;
        %>

        <tr style="text-align: center">
            <td><%=orderDetail.getName()%></td>
            <td><%=orderDetail.getNumber()%></td>
            <td><%=orderDetail.getComplete()%></td>
            <%
                if (orderDetail.getCompleteDetail() != null) {
            %>
            <td><%=orderDetail.getCompleteDetail().getCompleteNum()%></td>
            <%
                } else {
            %>
            <td>0</td>
            <%
                }
            %>
        </tr>
        <%
            }
        %>
    </table>
    <%-- <a href="back?account1=<%= request.getSession().getAttribute("account1") %>&type=<%=request.getSession().getAttribute("type")%>">返回</a> --%>
    <button onclick="window.history.back()">返回</button>
</div>
</body>
</html>